ssucgofandomcom-20200214-history
Macro Guide
A Macro is an automated script that performs whatever tasks you want it do to . It involves some code, but nothing the non-computer science person can't handle. You can use a Macro to do automated clicking, typing, and arrow movements. You need the following software AutoIT package or bundle or something that includes AutoIT, Au3Info, and SciTe. Macros will be extremely useful for AFK crafting, mining, and more. Tools of the Trade NOTE: If you installed a Start Menu shortcut, it may be called "Run Script". *AutoIT - The main program that executes the scripts *Au3Info - A small window that provides your mouse coordinates like x and y. On that window, scroll to the right and find the "Mouse" tab. That will show the Mouse cursor's coordinates and color code in case you use Pixel Scanning *SciTe - This is the script writing and editing feature of AutoIT. How to Use It The following source borrows most information from UCGO Private Server wiki. "A good way to start scripts is to have the first command be WinWaitActive("UCClient"). This makes the script wait until the game client is the active window before starting. Since all scripts for these tasks are done in endless loops, one of the key commands in the script to use would be While and WEnd. While is used to set the conditions for the loop and WEnd determines where the loop ends before starting again. After While, some sort of small equation is used to determine if it's an endless loop or stops after a certain amount of time to continue for something else. So most scripts will have something like "While 1 < 2" at the beginning to loop the entire script, since 1 is always less than 2, it makes it an endless loop. While 1 < 2 WEnd A good way to make a loop that ends after a certain amount would be to have a variable with a determined value, the While statement that sets the condition for the variable for the loop continue a certain amount of times, and an equation to change that variable. While 1 < 2 $x = 0 While $x < 5 $x = $x + 1 This is an example that will have the loop happen only five times before continuing to more of the script. Each time the second While statement is repeated, the value for X is increased by one until it reaches five. When the entire script loops back to the beginning, the value for X is reset to 0. Another key command to use would be the MouseClick command to determine where on your screen the script will make mouse clicks. This is followed immediately by determining which mouse button will be clicked, the x,y coordinates on your screen for where, the amount of clicks, and the speed. MouseClick("left",700,240,2,0) This example would have the mouse left click twice at 700,240. For knowing what coordinates you need for your screen, you should use the Au3Info tool like stated above. It's also best to have a lot of commands followed by a Sleep command to have the script wait somewhere between half of a second to a full second, if you wish to avoid problems with any bit of lag. Sleep(500) Sleep(1000) The Sleep(500) is for waiting for a half of a second and the Sleep(1000) is for waiting for a full second. Not putting this command after would have the next command happen instantly, and if there is any lag and the next is another click command, it would probably click again too early. This Sleep command should also be used for a 10 or more second wait to wait for progress bars of mining or crafting. Another major command to use is the Send command to have the script enter in /mine or /auto, depending on what your script is for. Send("/mine{ENTER}") After making a command to have the mouse click in the chat bar on bottom, this command would have it type in /mine and press the enter key. There are more advanced commands you can put into scripts, but these are really just the important basic ones that you can create full scripts for use in the game. One last note is that you can place a semicolon after a command to put a note about what the command is for, if you want. Weapons Crafting This is a sample Weapon's Crafting Script, you will need to modify the x and y co-ordinates in the MouseClick functions in order for it to match your screens resolution. Also this script runs assuming that you have turned off the sale confirmation when you sell items (Find that function in the Options Menu Translation Page), and that your vehicle/MS is in range of both a Weapons Factory and a Weapons Shop. This script will make 7 Weapons in the Weapons Facility, then sell them to the Weapons Shop, and will repeat this 30 times before logging off. You can add further functionality by adding transport routes if required and the ability to purchase more raw materials to continue the manufacturing process infinitely. $ExitKey="{ESC}";//This is the emergancy stop key HotKeySet($Exitkey, '_Exit'); Func _Exit() Exit EndFunc sleep(5000) $x = 0;//Make Weapon Counter $y = 0;//Sell Weapon Counter $a = 0;//Make/Sell Cycle Repetition While 1 < 2 Do MouseClick("left",x,y,2);//OPEN FACILITY sleep(1000); Do MouseClick("left",x,y,1);//MAKE sleep(2000); MouseClick("left",x,y,1);//SELECT ITEM sleep(2000); MouseClick("left",x,y,1);//MAKE ITEM sleep(41000);//Weapon creation time MouseClick("left",x,y,1);//OK sleep(2200); MouseClick("left",x,y,2);//OPEN FACILITY sleep(2000); MouseClick("left",x,y,1) sleep(2000); $x = $x + 1; Until $x = 7 $x = $x - 7; MouseClick("left",x,y,1);//CLOSE FACILITY sleep(1500); MouseClick("left",x,y,2);//OPEN WEAPONS SHOP sleep(2000); MouseClick("left",x,y,1);//SELL sleep(2000); MouseClick("left",x,y,1);//CONTAINER sleep(2000); Do MouseClick("left",x,y,1);//SELL ITEM sleep(3000); $y = $y + 1; Until $y = 7 $y = $y - 7; MouseClick("left",x,y,1);//CLOSE SHOP sleep(2000); $a = $a + 1; Until $a = 30; MouseClick("left",x,y,1);//LOGOUT sleep(2000); MouseClick("left",x,y,1);//Confirm sleep(200000000); WEnd" (UCGO PS wiki) MS/MA Crafting - will be added in due time "Mining Here is an example of a very basic mining script, it doesn't use /auto to go anywhere, just repeats a simple mining procedure. The x,y coordinates are going to be "xxx" and "yyy" because they can be changed for anyone's screen. WinWaitActive("UCClient") While 1 < 2 MouseClick("left",xxx,yyy,1,0); //Focus on the text input field at the bottom. Send("/mine{ENTER}"); //Input /mine command Sleep(11000); //Wait 11 seconds for the progress bar to reach 100%. MouseClick("left",xxx,yyy,1,0); //Click the OK button with a failed mine. MouseClick("left",xxx,yyy,1,0); //Click the OK button for one item. MouseClick("left",xxx,yyy,1,0); //Click the OK button for two items. MouseClick("left",xxx,yyy,1,0); //Click the OK button for three items. MouseClick("left",xxx,yyy,1,0); //Click the OK button for four items. MouseClick("left",xxx,yyy,1,0); //Click the OK button for five items WEnd" (UCGO PS wiki) Tailoring - Will be added in due time